if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DeleteCertificationContent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[DeleteCertificationContent]
GO
SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
/***************************************************************************
* Name:				 DeleteCertificationContent

* Purpose:			 This Stored Procedure Removes the serializedxml content from 
				 the temporary table after the PDF gets created.								
* PARAMETERS
* Name		          	 Description					
* -------------			 -----------------------------------------------------------
* @executionId int,		 ExecutionId with respect to WorkFlow
* @fwkDomainUserId int,		 FrameworkDomainUserId of the user accepting the 
				 participation through workflow
* @activityName varchar(200)	 WorkFlow Activity name (work flow which initiated the procedure)  

***************************************************************************/
Create Procedure dbo.[DeleteCertificationContent]
(  
@executionId int,  
@fwkDomainUserId int,  
@activityName varchar(200)  
)  
As   
BEGIN  
 If exists (Select Top 1 Id from WorkFlow_certified_content   
    where   
     ExecutionId=@executionId and  
     fwkDomainUserId = @fwkDomainUserId and   
     ActivityName = @activityName)  
 Begin  
	Delete from WorkFlow_certified_content where   
        ExecutionId=@executionId and  
        fwkDomainUserId = @fwkDomainUserId and   
        ActivityName = @activityName  
 End  
        
END